<template>
  <!-- 分页器 -->
 <el-pagination
      v-model:current-page="currentPage"
      v-model:page-size="prpos.pageSize"
      :page-sizes="[100, 200, 300, 400]"
      layout="total, prev, pager, next, jumper"
      :total="prpos.total"
      @current-change="handleCurrentChange"
    />
</template>

<script setup>
import { ref, definePrpos } from 'vue'
const currentPage = ref(1)
// 接受变量
const prpos = definePrpos(['total','pageSize'])
// 传递给父组件事件
const emit = defineEmits(['getCurrentPage'])
// const pageSize = ref(1)
// const total = ref(10)

const handleCurrentChange = (val) => {
  // console.log(`current page: ${val}`)
  emit('getCurrentPage',val)
}
</script>

<style lang="scss" scoped>

</style>